package cn.ck.springcloud.service;



import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import cn.ck.springcloud.entity.Product;
import cn.ck.springcloud.mapper.ProductMapper;

import java.util.List;

@Service //注意别忘了
public class ProductServiceImpl implements ProductService {
    @Autowired
    ProductMapper productMapper;

    @Override
    public boolean add(Product product) {
        return productMapper.addProduct(product);
    }

    @Override
    public Product get(Long id) {
        return productMapper.findById(id);
    }

    @Override
    public List<Product> list() {
        return productMapper.findAll();
    }
}